﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace PacketRush.Core
{
    /// <summary>
    /// Describes settings for <see cref="PacketRush.Core.NetServer"/> that
    /// can be changed dynamically whilst running.
    /// </summary>
    public class NetServerSettings
    {
        private int _MaxConnections = 16;

        /// <summary>
        /// The maximum number of connections allows at any one time.
        /// </summary>
        public int MaxConnections
        {
            get { return _MaxConnections; }
            set { _MaxConnections = value; }
        }

        private int _PingFrequency = 2000;
        /// <summary>
        /// How often to send the ping packet in miliseconds, defaults to 2 seconds (2000ms),
        /// set to 0 to disable ping packets
        /// </summary>
        /// <remarks>Ping packets are used to calculate the round-trip time in milliseconds.</remarks>
        public int PingFrequency
        {
            get
            {
                return _PingFrequency;
            }
            set
            {
                _PingFrequency = value;
            }
        }

        private int _MaxUnreceivedPingAcks = 10;

        /// <summary>
        /// The number of unreceived ping packet acknowledgements for a
        /// connection before the connection is considered disconnected,
        /// defaults to 10.
        /// </summary>
        public int MaxUnreceivedPingAcks
        {
            get { return _MaxUnreceivedPingAcks; }
            set { _MaxUnreceivedPingAcks = value; }
        }
    }
}